﻿Public Class Form2
    Public xA, yA, zA, xB, yB, zB, xC, yC, zC As Double

    Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click

    End Sub

    Private Sub zeroABtn_Click(sender As Object, e As EventArgs) Handles zeroABtn.Click
        xA = Form1.X
        yA = Form1.Y
        zA = Form1.Z
        Label13.Text = ("ZERO AT : (" + Str(xA) + "," + Str(yA) + "," + Str(zA) + ")")
        XATextBox.Text = 0
        YATextBox.Text = 0
        ZATextBox.Text = 0

    End Sub

    Private Sub zeroBBtn_Click(sender As Object, e As EventArgs) Handles zeroBBtn.Click
        xB = Form1.X
        yB = Form1.Y
        zB = Form1.Z
        Label14.Text = ("ZERO AT : (" + Str(xB) + "," + Str(yB) + "," + Str(zB) + ")")
        XBTextBox.Text = 0
        YBTextBox.Text = 0
        ZBTextBox.Text = 0
    End Sub

    Private Sub zeroCBtn_Click(sender As Object, e As EventArgs) Handles zeroCBtn.Click
        xC = Form1.X
        yC = Form1.Y
        zC = Form1.Z
        Label15.Text = ("ZERO AT : (" + Str(xC) + "," + Str(yC) + "," + Str(zC) + ")")
        XCTextBox.Text = 0
        YCTextBox.Text = 0
        ZCTextBox.Text = 0
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        XATextBox.Text = Form1.X - xA
        YATextBox.Text = Form1.Y - yA
        ZATextBox.Text = Form1.Z - zA
        XBTextBox.Text = Form1.X - xB
        YBTextBox.Text = Form1.Y - yB
        ZBTextBox.Text = Form1.Z - zB
        XCTextBox.Text = Form1.X - xC
        YCTextBox.Text = Form1.Y - yC
        ZCTextBox.Text = Form1.Z - zC
    End Sub

    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Timer1.Interval = 100
        Timer1.Start()
    End Sub
End Class